package com.how.warlock.entities;

import com.how.warlock.engine.Sprite;
import com.how.warlock.player.Camera;


public class Entity {
	protected double x;
	protected double y;
	
	protected int width, height;
	
	protected boolean midHandle;
	
	public Sprite sprite;

	protected Entity(int x, int y){
		this.x = x;
		this.y = y;
	}
	
	protected Entity(Sprite sprite, int x, int y){
		this.sprite = sprite;
		this.width = sprite.getWidth();
		this.height = sprite.getHeight();
		
		this.x = x;
		this.y = y;
	}


	
	public void doLogic(){
	}
	
	protected void draw(){
		int tx = (int) x - Camera.getX();
		int ty = (int) y - Camera.getY();
		
		if(midHandle) { 
			tx -= sprite.getWidth();
			ty -= sprite.getHeight();
		}
		
		sprite.draw(tx , ty);
	}

	
	public int getX(){
		return (int) x;
	}
	
	public int getY(){
		return (int) y;
	}
}
